package cn.wolfcode.plus.service.impl;

import cn.wolfcode.plus.domain.Announcement;
import cn.wolfcode.plus.mapper.AnnouncementMapper;
import cn.wolfcode.plus.qo.PageResult;
import cn.wolfcode.plus.qo.QueryObject;
import cn.wolfcode.plus.service.IAnnouncementService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * Author wyy
 * Date 2021/2/17 23:33
 **/
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement>
        implements IAnnouncementService {
    @Override
    public PageResult<Announcement> query(QueryObject qo) {
        return new PageResult<>(this.baseMapper.selectForList(new Page<>(qo.getCurrentPage(),qo.getPageSize()),null));
    }

    @Override
    public void addHasRead(Long eid, Long aid) {
        this.baseMapper.addHasRead(eid, aid);
    }
}
